<!DOCTYPE html>
<html lang="zh-CN">

<#assign html_title="搬砖之家">
    <head>

        <#include "/components/head.htm"   />
        <style>
            .card{
                width: 200px;
                height: 120px;
                margin: 15px;
            }

            .bs-callout {
                padding: 20px;
                margin: 20px 0;
                border: 1px solid #eee;
                border-left-width: 5px;
                border-radius: 3px;
            }
            .bs-callout-warning {
                border-left-color: #aa6708;
            }
            .bs-callout + .bs-callout {
                margin-top: -5px;
            }
        </style>
    </head>
    <body>
    <div id="fullPage">
        <!--Page One-->
        <#include "/components/header.section.htm"   />
        <section>
            <div class="container white-block">

                <#if sites??>
                    <h3>选择订阅的套餐</h3>
                    <form id="form" action="/view/order/preview" method="get">
                        <input id="combo" type="hidden" name="combo" value="">
                        <#list sites as site>
                            <input type="hidden" name="site" value="${site}">
                        </#list>
                    </form>
                        <br>
                        <div class="row">
                            <#list combos as combo>
                                <div class="col-md-3 text-center select-combo" data-combo="${combo.code}">
                                    <a class="btn btn-default card" >${combo.name}
                                        <h6>
                                            每组订阅:${combo.price}元
                                            <br/><br/>
                                            每组天数: ${combo.day}天
                                        </h6>
                                    </a>
                                </div>
                            </#list>

                        </div>

                <#else>
                    <div class="bs-callout bs-callout-warning" id="callout-helper-bg-accessibility">
                        <h4>选择了网站了才能进行购买订阅套餐</h4>
                        <p>请先 <a href="/view/buy/select" ><b>选择订阅的网站</b></a>, 确认需要订阅的网站，支持一次多选.</p>
                    </div>
                </#if>


            </div>
        </section>
    </div>
    <script>
        $(document).ready(function () {
            $(".select-combo").click(function () {
                $("#combo").val($(this).data('combo'));
                $('#form').submit();
            });
        });
    </script>
    </body>

</html>